﻿@model eduscrum.ViewModels.SprintVM

@{
    ViewBag.Title = "scrumboard.net - Eduscrum ";
    Layout = "~/Views/Shared/_Board.cshtml";
}
<script type="text/javascript" language="javascript">
    function changeSprint() {
        var list = document.getElementById('SprintsDDL');
        window.open('@Url.Content("~/Board/Index/")' + @Model.Project.ProjectID + "?sprintID=" + list.options[list.selectedIndex].value, '_self');
    }
</script>
<div id="navigation"> 
			<ul>
                <li><span id="navigationtitle">@Html.ActionLink("ScrumBoard.net", "Index", "Project")</span></li>
			    <li>
                    @Html.ActionLink("Current Projects", "Index", "Project")
                </li>
			    <li>
                    @Html.ActionLink("Create New Project", "Create", "Project")
                </li>
			    <li>
                    <a href="#" onclick="alert('EduScrum v 0.5\n \nAuthors:\n \nJesper N.\nBørge B.\nDaniel K.');">About</a>
                </li>
                <li>
                    <b>|</b>
                </li>
				<li>
					Sprint&nbsp;
                    @Html.DropDownList("SprintsDDL", null, new { onchange = "changeSprint()" })
				</li>
				<li><a href="#">Product Backlog</a></li>
				<li><a href="#">Project Details</a></li>
			</ul>
		</div>

		<div id="phases">
        @for (int p = 1; p <= Model.Project.Phases.Count;p++)
        {
            //current sprint
            int cs = 0;
            //number is odd
            if (p % 2 != 0)
            {
			<div class="phase phaseodd">
                <div id="phase@(p)">
				    <div class="phasetitle">@Model.Project.Phases[p-1].Name<br /><hr /></div>
				    @foreach (var story in Model.SprintBacklog)
                    {
                        if(story.Phase.PhaseID == story.Project.Phases[p - 1].PhaseID)
                        {
                            <div class="story">
                                <div class="storyheader">#@story.UserStoryID - @story.Title</div>
                                <div class="storycontent">@story.Description</div>
                                <div class="storypoints">Story Points: @story.StoryPoints</div>
                                <div class="storypriority">Priority: @story.Priority</div>
                            </div>
                        }
                    }
                </div>
			</div>
            }

            //number is even
            else
            {
			<div class="phase phaseeven">
				<div id="phase@(p)">
                    <div class="phasetitle">@Model.Project.Phases[p-1].Name<br /><hr /></div>
                    @foreach (var story in Model.SprintBacklog)
                    {
                        if (story.Phase.PhaseID == story.Project.Phases[p - 1].PhaseID)
                        {
                            <div class="story">
                                <div class="storyheader">#@story.UserStoryID - @story.Title</div>
                                <div class="storycontent">@story.Description</div>
                                <div class="storypoints">Story Points: @story.StoryPoints</div>
                                <div class="storypriority">Priority: @story.Priority</div>
                            </div>
                        }
                     }
                </div>
			</div>
            }
        }
		</div>
        
        
        <div id="infocontainer">
            <div id="infobar" onmousedown="showHideInfoarea();">
                <div id="infobartooltipleft"> ▲ open</div>
                <div id="infobartooltipright">open ▲</div>
            </div>
            <div id="infoarea">
                <div id="infoareaelementcontainer">
                    <div id="productbacklog" class="infoareaelement">
                        <div class="infoareaheader">Product Backlog</div>
                        <select name="misctasks" multiple > 
                            <option value="1" >Task 1</option>
                            <option value="1" >Task 2</option>
                            <option value="1" >Task 3</option>
                        </select>
                    </div>
                    <div id="misctasks" class="infoareaelement">
                        <div class="infoareaheader">Miscellaneous Tasks</div>
                        <select name="misctasks" multiple > 
                            <option value="1" >Task 1</option>
                            <option value="1" >Task 2</option>
                            <option value="1" >Task 3</option>
                        </select>
                    </div>
                    <div id="empidiments" class="infoareaelement">
                        <div class="infoareaheader">Empidiments</div>
                        <select name="misctasks" multiple > 
                            <option value="1" >Task 1</option>
                            <option value="1" >Task 2</option>
                            <option value="1" >Task 3</option>
                        </select>
                    </div>
                    <div id="burndownsprint" class="infoareaelement">
                        <div class="infoareaheader">Burndown Chart: Sprint</div>
                        <img src="../../images/burndown.png" height="170" width="215"/>
                    </div>
                    <div id="burndownproject" class="infoareaelement">
                        <div class="infoareaheader">Burndown Chart: Project</div>
                        <img src="../../images/burndown.png" height="170" width="215"/>
                    </div>
                </div>
            </div>
        </div>
